/**
 * 
 */
package com.hexacta.hrs.services.feedbacks.training.impl;

import java.util.List;

import com.hexacta.hrs.domain.feedback.training.Training;
import com.hexacta.hrs.repositories.feedback.training.TrainingRepository;
import com.hexacta.hrs.services.feedbacks.training.TrainingService;

/**
 * @author gvilla
 * 
 */
public class TrainingServiceImpl implements TrainingService {

    private TrainingRepository trainingRepository;

    /**
     * @return the trainingRepository
     */
    public TrainingRepository getTrainingRepository() {
        return trainingRepository;
    }

    /**
     * @param trainingRepository
     *            the trainingRepository to set
     */
    public void setTrainingRepository(final TrainingRepository trainingRepository) {
        this.trainingRepository = trainingRepository;
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.hexacta.hrs.services.feedbacks.training.TrainingService#searchByName
     * (java.lang.String)
     */
    @Override
    public List<Training> searchByName(final String name) {
        return trainingRepository.getByName(name);
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.hexacta.hrs.services.feedbacks.training.TrainingService#save(com.
     * hexacta.hrs.domain.feedback.training.Training)
     */
    @Override
    public void save(final Training training) {
        trainingRepository.save(training);
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * com.hexacta.hrs.services.feedbacks.training.TrainingService#matching(
     * com.hexacta.hrs.domain.feedback.training.Training)
     */
    @Override
    public List<Training> matching(final Training example) {
        return (List<Training>) trainingRepository.matching(example);
    }

}
